<div class="work">
	<% if @login_user == @work.user%>
	<div class="work_op">
		<%= link_to '编辑', edit_work_path(@work) %> |
		<%= link_to '返回', works_path %>		
	</div>
	<% end %>
	
	<div class="work_title">
	  <b>标题：</b>
	  <%=h @work.title %>
	</div>

	<div class="work_content">
	  <b>描述：</b>
	  <%=h @work.content %>
	</div>

	<div class="picture">
		<% @work.pictures.each do |p| %>
		  <%= image_tag p.data.url(:resized) %>
		<% end %>
	</div>
	
	<div class="work_bottom" id="comment_num_for_work_<%= @work.id%>">
		浏览<%= @work.click_times.to_s.or_else("0")%>|回复<%= @work.work_comments.length%>
	</div>

	<div id="comments_for_work_<%= @work.id%>" class="work_comments">
		<%@comments = @work.work_comments.paginate(:page => params[:page], :per_page => PERPAGE)%>
		<%= will_paginate @comments%>
		<%= render :partial =>"/work_comments/comment", :collection => @comments%>
	</div>
	
	<% if logged_in? %>
	<div id="add_comment_for_work_<%= @work.id %>" class="add_comments">
		<%= link_to_remote "发表评论", :url => new_work_work_comment_url(@work), :method => :get %>
	</div>
	<div id="new_comment_for_work_<%= @work.id%>">
		
	</div>
	<% end %>
</div>

